<template>
  <div>
    <button @click="show">显示/隐藏</button>
    <transition-group appear
                      name="animate__animated animate__bounce"
                      enter-active-class="animate__backInDown"
                      leave-active-class="animate__backOutDown"
    >
      <h1 v-show="isShow" class="text" key="1">你好</h1>
      <h1 v-show="isShow" class="text" key="2">不好</h1>
    </transition-group>
  </div>
</template>

<script>
import 'animate.css'

export default {
  // eslint-disable-next-line vue/multi-word-component-names
  name: 'Test4',
  data() {
    return {
      isShow: true
    }
  },
  methods: {
    show() {
      this.isShow = !this.isShow
    }
  }
}
</script>

<style scoped>
.text {
  background: skyblue;
}

</style>
